// 接口方法, 只负责调用一个接口, 返回一个Promise对象
import request from '../utils/request'
// export const allChannelListAPI = () => {
//   return request({
//     url: '/v1_0/channels'
//   })
// }
// 用户 - 登录
export const loginAPI = ({ username, password }) => {
  return request({
    url: '/user/login',
    method: 'POST',
    data: {
      username,
      password
    }
  })
}
// 查询房屋条件
export const houseListAPI = ({ cityId, area, subway, rentType, price }) => {
  return request({
    url: '/houses',
    method: 'GET',
    params: {
      cityId,
      area,
      subway,
      rentType,
      price
    }
  })
}
// 首页轮播图接口
export const swiperApi = () => {
  return request({
    url: '/home/swiper'
  })
}

// 获取城市列表
export const cityListAPI = ({ level = 1 }) => {
  return request({
    url: '/area/city',
    params: {
      level: level
    }
  })
}

// 获取热门城市
export const hotCityApi = () => {
  return request({
    url: '/area/hot'
  })
}
